//
//  XFXFashionTwoTableViewCell.m
//  XFXnews
//
//  Created by dllo on 16/2/27.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "XFXFashionTwoTableViewCell.h"


@interface XFXFashionTwoTableViewCell ()

@property (nonatomic, retain) UILabel *title;
@property (nonatomic, retain) UILabel *digest;
@property (nonatomic, retain) UILabel *replyCount;
@property (nonatomic, retain) UIImageView *myImageView;

@end

@implementation XFXFashionTwoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }return self;
}

- (void)createSubViews{
    
    self.title = [[UILabel alloc] initWithFrame:CGRectMake(XFXWIDTH * 0.008, XFXHEIGHT * 0.002, XFXWIDTH, 10 * XFXSHEI)];
    [self.contentView addSubview:self.title];
    
    self.myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.title.frame.origin.x, self.title.frame.origin.y + self.title.frame.size.height + 5 * XFXSWID, XFXWIDTH, XFXHEIGHT * 0.15)];
    [self.contentView addSubview:self.myImageView];
    
    self.digest = [[UILabel alloc] initWithFrame:CGRectMake(self.myImageView.frame.origin.x, self.myImageView.frame.origin.y + self.myImageView.frame.size.height, XFXWIDTH, 10 * XFXSHEI)];
    [self.contentView addSubview:self.digest];
    
    UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(XFXWIDTH - 30 * XFXSWID, self.digest.frame.origin.y, XFXWIDTH, 10 * XFXSHEI)];
    lab.text = @"专题";
    lab.textColor = [UIColor redColor];
    [self.contentView addSubview:lab];
    lab.font = [UIFont systemFontOfSize:12.0];
    [lab sizeToFit];
    
}

- (void)setModel:(XFXNewsHeadLineModel *)model{
    
    _model = model;
    self.title.text = _model.title;
    self.title.font = [UIFont systemFontOfSize:13.0];
    [self.title sizeToFit];
    self.digest.text = _model.digest;
    self.digest.font = [UIFont systemFontOfSize:13.0];
    [self.digest sizeToFit];
    self.replyCount.text = [NSString stringWithFormat:@"%@",_model.replyCount];
    self.replyCount.font = [UIFont systemFontOfSize:13.0];
    [self.replyCount sizeToFit];
    NSURL *url = [NSURL URLWithString:_model.imgsrc];
    [_myImageView sd_setImageWithURL:url placeholderImage:nil];
    
}



@end
